﻿using DAL;
using EntitiesLayer;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class GestorTipoMaquina
    {

        public IEnumerable<TipoMaquina> listarTipoMaquinas()
        {
            IEnumerable<TipoMaquina> lista = UnitOfWork.RepositoryTipoMaquina.GetAll();
                
            return lista;
        }


        public TipoMaquina getTipoMaquinaById(int id)
        {
            try
            {
                return UnitOfWork.RepositoryTipoMaquina.GetById(id);
            }
            catch (SqlException ex)
            {
                Console.WriteLine(ex.Message);

            }
            catch (ApplicationException ex)
            {

                Console.WriteLine(ex.Message);

            }

            return null;
        }

    }
}
